#region License Revision: 0 Last Revised: 6/18/2008 11:00 AM
/******************************************************************************
Copyright (c) Microsoft Corporation.  All rights reserved.


This file is licensed under the Microsoft Public License (Ms-PL). A copy of the Ms-PL should accompany this file. 
If it does not, you can obtain a copy from: 

http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx
******************************************************************************/
#endregion // License
using System;
using System.Windows.Browser;
using System.Diagnostics;
using ScriptInterop;
using System.Collections.ObjectModel;

namespace VIEWS // Virtual Earth Wrapper
{

/// <summary>A found result returned from a location search.</summary>
public class VEPlace : JSObject
{   
	/// <summary>String holding JavaScript class name</summary>
	private static string thisClass = "VEPlace";
	
	/// <summary>Get the JavaScript class name</summary>
	/// <returns type="String">The class name used in JavaScript </returns>		
	public override string ClassName
	{
		get { return thisClass; }
	}

	/// <summary>Construct a C# wrapper from a ScriptObject</summary>
	/// <param name="so">A ScriptObjet from JScript.</param>
	public VEPlace(ScriptObject so) : base(so) { }

	/// <summary>Construct an empty C# wrapper from a ScriptObject</summary>
	public VEPlace() { }

	/// <summary name="LatLong" type="VELatLong">Gets a VELatLong Class object that represents the best location of the found result.</summary>
	public VELatLong LatLong
	{
		get { var so = GetProperty<ScriptObject>("LatLong"); return new VELatLong(so); }
	}
	
	/// <summary name="Locations" type="Array">An array of VEGeocodeLocation Class objects specifying all of the possible match results returned by the geocoder for this place.</summary>
	public VEGeocodeLocation[] Locations
	{
		get 
		{ 
			return ConvertToArray<VEGeocodeLocation>(GetProperty<ScriptObject>("Locations"));
		}
	}
	
	/// <summary name="Name" type="String">Gets the String object that represents Virtual Earth's unambiguous name for the location.</summary>
	public string Name
	{
		get { return GetProperty<string>("Name"); }
	}
	/// <summary name="MatchCode" type="VEMatchCode">A VEMatchCode Enumeration value specifying the match code from the geocoder. This property value is only valid for where-only searches.</summary>
	public VEMatchCode MatchCode
	{
		get 
		{
			int match = GetProperty<int>("MatchCode");
			VEMatchCode mc = (VEMatchCode)match;
			return mc;
		}
	}
	/// <summary name="MatchConfidence" type="VEMatchConfidence">A VEMatchConfidence Enumeration value specifying the match confidence from the geocoder. This property value is only valid for where-only searches.</summary>
	public VEMatchConfidence MatchConfidence
	{
		get 
		{
			int conf = GetProperty<int>("MatchConfidence"); 
			return (VEMatchConfidence)conf;
		}
	}
	/// <summary name="Precision " type="VELocationPrecision">A VELocationPrecision Enumeration value specifying the match precision from the geocoder for the best result, which is found in the VEPlace.LatLong property.</summary>
	public VELocationPrecision Precision
	{
		get 
		{
			int conf = GetProperty<int>("MatchConfidence");
			return (VELocationPrecision)conf;
		}
	}
}

}
